import urllib.request
import os
# Step2
read = open(r"C:\Users\CoolGuy\Desktop\spider\url.txt", "r", encoding="utf-8")
s = read.readlines()
print("正在爬取，请稍后！")
q = 1                       #设置图片名称从1开始
os.chdir(r"C:\Users\CoolGuy\Desktop\spider\picture")     #指定存储路径
for i in s:
    print(i)
    urllib.request.urlretrieve(i, filename=str(q)+".jpg")   # i为图片地址，filename是图片的名称
    q=q+1
print("爬取完成！")